# 定义一个断言的方法
from app import BASE_PATH


def assert_api(self,response,status_code,status,description):
    self.assertEqual(status_code,response.status_code)
    self.assertEqual(status,response.json().get("status"))
    self.assertEqual(description,response.json().get("description"))

def assert_img(self,response,status_code):
    self.assertEqual(status_code,response.status_code)



# 读取json文件


import json
# 存为元组列表,定义一个读取方法
# def read_json():
#     with open(BASE_PATH + "/data/img.json", encoding="utf-8") as f:
#         res = json.load(f)
#         # print(res)
#     list_data = []
#     for item in res:
#         info = tuple(item.values())
#         list_data.append(info)
#     return list_data
#
#
# if __name__ == '__main__':
#     print(read_json())

# 定义一个读取方法,最终转为元组列表
import json
def read_json(filename):
    with open(BASE_PATH+"/data/"+filename,"r",encoding="utf-8") as f:
        res = json.load(f)
        print(res)
    # list_data = []
    # for i in res:
    #     ren = tuple(i.values())
    #     list_data.append(ren)
    # return list_data

if __name__ == '__main__':
    print(read_json("real_name.json"))


    ''